package demo;

/**
 * Created by zwz
 * date 2017/1/16
 * project demo
 *
 * 进制转换
 */
public class Demo {
    public static void main(String[] args) {
        String st = "";
        Long i = 189L;
        //进制
        int j = 2;
        while (true) {
            if (i % j == 0) {
                st = "0" + st;
                i = i / j;
            } else if(i>j){
                st =  i % j + st;
                i = (i - i % j) / j;
            }else {
                st =  i+ st;
                break;
            }
//            System.out.println(i);
        }
        System.out.println(st);
    }
}
